home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / cdbw.zip / SABOUT.C < prev    next >
Text File  |  1991-05-15  |  2KB  |  69 lines

  1. /*
  2.  *  SABOUT.C
  3.  *
  4.  *  This module contains functions associated with the about dialog box
  5.  *  in SAMPLE.EXE.
  6.  *
  7.  *  Copyright (C) 1991 by Daytris.  All rights reserved.
  8.  */
  9.  
  10. #include <windows.h>
  11. #include "sampledb.h"
  12. #include "sample.h"
  13.  
  14.  
  15. /************************************************
  16.  * Function Declarations
  17.  ************************************************/
  18.  
  19. void AboutDlg( HWND hWnd);
  20. BOOL FAR PASCAL AboutProc( HWND hDlg, unsigned iMessage, WORD wParam,
  21.     LONG lParam);
  22.  
  23.  
  24. /***************************************************************************
  25.  * Function : AboutDlg
  26.  *
  27.  * Purpose  : This function drives the About dialog box.
  28.  *
  29.  * Returns  : n/a
  30.  ***************************************************************************/
  31. void AboutDlg( HWND hWnd)
  32.     {
  33.     short nStatus;
  34.     FARPROC lpfnAboutProc;
  35.  
  36.     /* Create an instance and open the About dialog */
  37.     lpfnAboutProc = MakeProcInstance( AboutProc, hInst);
  38.     nStatus = DialogBox( hInst, "about", hWnd, lpfnAboutProc);
  39.     FreeProcInstance( lpfnAboutProc);
  40.     }
  41.  
  42.  
  43. /***************************************************************************
  44.  * Function : AboutProc
  45.  *
  46.  * Purpose  : This function is the window procedure for the About dialog.
  47.  *
  48.  * Returns  : TRUE  - message processed
  49.  *            FALSE - message not processed
  50.  ***************************************************************************/
  51. BOOL FAR PASCAL AboutProc( HWND hDlg, unsigned iMessage, WORD wParam,
  52.     LONG lParam)
  53.     {
  54.     switch( iMessage)
  55.         {
  56.         case WM_COMMAND:
  57.             switch( wParam)
  58.                 {
  59.                 case IDOK:
  60.                 case IDCANCEL:
  61.                     EndDialog( hDlg, TRUE);
  62.                     break;
  63.                 }
  64.             return TRUE;
  65.         }
  66.  
  67.     return FALSE;
  68.     }
  69.